<?php
require '../home/config.php';
$client_id = 'taigameandroidscom';
$client_key = '1e53f93ec3f6cc1fe7b7ba1f57bcc243';
$access_code = 'TXc9PU9kdXNJYVQ=';
$token_url = 'http://superlink.zencms.vn/oauth/accessCode/'.$access_code.'';
$ch = curl_init($token_url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "{$client_id}:{$client_key}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$respone_data = curl_exec($ch);
//var_dump($respone_data);die;
$info = json_decode(base64_decode($respone_data),true);
var_dump($info);die;
$opts = array('http' =>
  array(
    'method'  => 'POST',
    'header'  => "Content-Type: text/xml\r\n".
      "Authorization: Basic ".base64_encode("$client_id:$client_key")."\r\n",
    'content' => '',
    'timeout' => 60
  )
);                    
$context  = stream_context_create($opts);
//$result = file_get_contents($token_url, false, $context, -1, 40000);
//$info = json_decode(base64_decode($result),true);
//var_dump($info);die;
$ch = curl_init($token_url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "{$client_id}:{$client_key}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$respone_data = curl_exec($ch);
//var_dump($respone_data);die;
$info = json_decode(base64_decode($respone_data),true);
var_dump($info);die;
die;
?>
<html>
<head>
<title>Test</title>
   <script type="text/javascript" src="/themes/js/jquery-1.9.0.min.js"></script>
</head>
<body>
<a href="javascript:;" class="hack">hack like</a>
<script>
$('.hack').click(function(){
   $.ajax({
        type:'GET',
        url:'http://www.thegioididong.com/commentv3/ajax/index',
        data:{'core[ajax]':true,'core[call]':'cmt.like',commentID:4455045,'core[security_token]':'Jop7o',_:1414990530065},
        dataType:type,
        beforeSend:function(){
        },
        success:function(result){
            $('.res').append(result);
        }
    })
});
</script>
<div class="res"></div>
<form action="http://localhost:5009/test/index.php" method="POST">
   <input type="text" name="name" value="" />
   <input type="submit" name="submit" />
</form>
</body>
</html>